package com.daxt.model.service.archives.vo;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "案件挂接文件", description = "案件挂接文件")
//@TableName("\"daxt\".\"ARCHIVES_DOC_FILE\"")
@TableName("archives_doc_file")
public class ArchivesDocFile  implements Serializable{
	
	private static final long serialVersionUID = 1L;


	@TableId(value = "id", type = IdType.AUTO)
	private Long id;
	
	@ApiModelProperty(value = "文件ID", name = "docId")
	private Long docId;
	
	@ApiModelProperty(value = "文件名", name = "fileName")
	private String fileName;
	
	@ApiModelProperty(value = "文件类型", name = "extName")
	private String extName;
	
	@ApiModelProperty(value = "文件url", name = "fileUrl")
	private String fileUrl;

	// add by lig 2021-07-27
	@ApiModelProperty(value = "文件类型  1代表doc、docx  2代表img  3代表mp4  4代表mp3  5代表html", name = "fileType")
	private String fileType;

	@ApiModelProperty(value = "文件大小", name = "fileSize")
	private String fileSize;

	// add by lig 2021-07-22  展示需要
	@ApiModelProperty(value = "文件件号", name = "itemNum")
	@TableField(exist = false)
	private String itemNum;


	@ApiModelProperty(value = "是否使用文件的真实名称", name = "isRealName")
	@TableField(exist = false)
	private Boolean isRealName;

	@ApiModelProperty(value = "是否属于从oa系统上传的文件", name = "isOA")
	@TableField(exist = false)
	private Boolean isOA;

	@ApiModelProperty(value = "上传人id", name = "userId")
	@TableField("userid")
	private String userId;

	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间", name = "createTime",example = "2019-09-09 00:00:00")
    private LocalDateTime createTime;



	public ArchivesDocFile() {}
	public ArchivesDocFile(Long docId, String fileName, String fileType, String extName, String fileUrl,String fileSize) {
		this.docId = docId;
		this.fileName = fileName;
		this.fileType = fileType;
		this.extName = extName;
		this.fileUrl = fileUrl;
		this.createTime = LocalDateTime.now();
		this.fileSize = fileSize;
	}
	public ArchivesDocFile(Long docId, String fileName, String fileType, String extName, String fileUrl,String fileSize,String userId) {
		this.docId = docId;
		this.fileName = fileName;
		this.fileType = fileType;
		this.extName = extName;
		this.fileUrl = fileUrl;
		this.createTime = LocalDateTime.now();
		this.fileSize = fileSize;
		this.userId = userId;
	}

   
}